-- type "extend" into the message box and press return to make
-- three months worth of new cards.
answer "Make three months more of new cards?" with "OK" or "Cancel"
if it is "Cancel" then exit extend
push card
go to last card of this background
put getStartDate() into start --what date to begin on
if start is "Cancel" then exit extend
put 60*60*24 into OneDay --seconds in a day
set lockScreen to true
set cursor to 4
repeat with cnt = 1 to (365 div 4) --three months
put start into it --a copy
convert it to long date
put it into field "Action Date"
add OneDay to start
doMenu New Card
put "F" into field "RButton T/F" -- indicates that action item is not done
doMenu New Button
set name of button "New Button" to "Done"
set style of button "Done" to radioButton
set rect of button "Done" to 49,99,67,115
set loc of button "Done" to 58,107
set autoHilite of button "Done" to false
set ShowName of button "Done" to false
set script of button "Done" to "on mouseUp" & return & "if hilite of card button 1 is false then" & return & "set hilite of card button 1 to true" & return & "put T into field 3" & return & "else" & return & "set hilite of card button 1 to false" & return & "put F into field 3" & return & "end if" & return & "end mouseUp" & return
end repeat
set lockScreen to false
choose browse tool
convert start to long date --fix the last card
put start into field "Action Date"
--go to next card
pop card
end extend
function getStartDate
-- end of stack or today, whichever is newer
get field "Action Date"
if it is empty then put the short date into it
convert it to seconds --so we can compare
put the short date into today
convert today to seconds
if today < 2587766400 then
answer "Set the Control Panel to today's date" with "OK"
return "Cancel"
end if
if it >= today then return it --calendar already beyond today
convert it to short date
answer "Start from which date?" with it or the short date or "Cancel"
if it is "Cancel" then return it
convert it to seconds
return it
end getStartDate
on openBackground
push recent card
set lockScreen to true
hide background field 3
hide background field 4
hide background button "hide button 1"
hide background button "hide button 2"
hide background button "hide button 3"
hide background button "hide button 4"
set lockScreen to false
end openBackground
-- part 4 (field)
-- low flags: 00
-- high flags: 0007
-- rect: left=69 top=100 right=264 bottom=447
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: To Do Text
-- part 7 (button)
-- low flags: 80
-- high flags: 2000
-- rect: left=220 top=319 right=342 bottom=252
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
go to previous card
click at 72,109
end mouseUp
-- part 8 (button)
-- low flags: 80
-- high flags: 2000
-- rect: left=259 top=318 right=342 bottom=293
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
go to next card
click at 72,109
end mouseUp
-- part 9 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=276 top=76 right=92 bottom=452
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Action Date
-- part 10 (button)
-- low flags: 00
-- high flags: 8004
-- rect: left=469 top=281 right=298 bottom=511
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Extend
----- HyperTalk script -----
on mouseUp
extend
end mouseUp
-- part 12 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=474 top=45 right=77 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 20098 / 20098
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
on mouseUp
visual effect iris close
go Home
end mouseUp
-- part 36 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=9 top=278 right=317 bottom=38
-- title width / last selected line: 0
-- icon id / first selected line: 8538 / 8538
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Find...
----- HyperTalk script -----
on mouseUp
global searchString
if the OptionKey is not down then
answer "What type of search?" with "Keyword" or "Start Date" or "Due Date"
put it into Type
if Type is "Start Date" then
ask "Enter Start Date (MM/DD/YY) for search:" with searchString
put it into searchString
else if Type is "Keyword" then
ask "Enter Keyword for search:" with searchString
put it into searchString
else if Type is "Due Date" then
ask "Enter Due Date (MM/DD/YY) for search:" with searchString
put it into searchString
end if
else
put "Keyword" into Type
end if
if searchString is empty then exit mouseUp
set lockscreen to true
go next
if Type is "Start Date" then
convert searchString to long date
Find searchString in background field "Action Date"
else if Type is "Keyword" then
Find searchString in background field "Keywords"
else if Type is "Due Date" then
convert searchString to long date
find searchString in background field "DueDate"
end if
if the result = "not found" then
play boing
answer "Sorry, can't find a matching entry!" with "OK"
go prev
else
play harpsichord "ee c"
end if
set lockScreen to false
end mouseUp
-- part 38 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=0 top=185 right=222 bottom=45
-- title width / last selected line: 0
-- icon id / first selected line: 26481 / 26481
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Card
----- HyperTalk script -----
on mouseUp
set hilite of background button "New Card" to true
set cursor to 4
set lockScreen to true
set lockText of field 2 to false
drag from 276,84 to 600,125 with shiftKey
set lockText of field 2 to true
doMenu Copy Text
doMenu New Card
put "F" into field "RButton T/F" -- indicates that action item is not done
doMenu New Button
set name of button "New Button" to "Done"
set style of button "Done" to radioButton
set rect of button "Done" to 49,99,67,115
set loc of button "Done" to 58,107
set autoHilite of button "Done" to false
set ShowName of button "Done" to false
set script of button "Done" to "on mouseUp" & return & "if hilite of card button 1 is false then" & return & "set hilite of card button 1 to true" & return & "put T into field 3" & return & "else" & return & "set hilite of card button 1 to false" & return & "put F into field 3" & return & "end if" & return & "end mouseUp" & return
choose browse tool
set lockScreen to false
set hilite of background button "New Card" to false
answer "What start date should be used for this card?" with "Prev Card" or "Today"
set lockText of field 2 to false
if it is "Prev Card"
then
click at 276,84
doMenu Paste Text
set lockText of field 2 to true
else if it is "Today"
then
put the long date into field 2
set lockText of field 2 to true
end if
click at 72,109
end mouseUp
-- part 39 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=4 top=45 right=80 bottom=39
-- title width / last selected line: 0
-- icon id / first selected line: 24575 / 24575
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Compact
----- HyperTalk script -----
on mouseUp
set hilite of background button Compact to true
doMenu Compact Stack
set hilite of background button Compact to false
end mouseUp
-- part 40 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=469 top=132 right=165 bottom=511
-- title width / last selected line: 0
-- icon id / first selected line: 32670 / 32670
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: View...
----- HyperTalk script -----
on mouseUp
set lockScreen to true
push card
answer "View from where in stack?" with "Beginning" or "Here" or "Cancel"
if it is "Cancel" then exit mouseUp
if it is "Beginning" then
put number of cards - 12 into N
go to first card of background "Action Items"
set lockScreen to false
show N cards
else
put number of cards - the number of this card into N
set lockScreen to false
show N cards
end if
end mouseUp
-- part 41 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=4 top=228 right=271 bottom=37
-- title width / last selected line: 0
-- icon id / first selected line: 6071 / 6071
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Delete...
----- HyperTalk script -----
on mouseUp
put the number of this card into N
play harpsichord "ee c"
if the OptionKey is not down then
if field "Action Date" is empty then
answer "Delete this card?" with "OK" or "Cancel"
else
answer "Delete " & "“" & Field "Action Date" & "” ?" with "OK" or "Cancel"
end if
else
put "OK" into it
end if
set lockScreen to true
if N = number of cards then
if it = "OK" then doMenu Delete Card
go to last card
set lockScreen to false
else
if it = "OK" then doMenu Delete Card
set lockScreen to false
end if
end mouseUp
-- part 42 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=471 top=173 right=218 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 20186 / 20186
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Sort...
----- HyperTalk script -----
on mouseUp
set lockScreen to true
answer "Sort by what criteria?" with "Keyword" or "Start Date" or "Due Date"
put it into sorType
if sorType is "Start Date" then
sort dateTime by field "Action Date"
else if sorType is "Keyword" then
prepSort
sort by first word of first line in field "Keywords"
fixSort
else if sorType is "Due Date" then
sort dateTime by field "DueDate"
end if
go to first card of background "Action Items"
set lockScreen to false
end mouseUp
on prepSort
go to first card of background "Action Items"
set cursor to 4
repeat for number of cards - 11
if field "Keywords" is empty
then
put "zzz" into field "Keywords"
end if
go next card
end repeat
end prepSort
on fixSort
go to first card of background "Action Items"
set cursor to 4
repeat for number of cards - 11
if field "Keywords" = "zzz"
then
put "" into field "Keywords"
end if
go next card
end repeat
end fixSort
-- part 43 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=467 top=225 right=262 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Calendar
----- HyperTalk script -----
on mouseUp
push card
put field "Action Date" into field "CalDate"
if field "CalDate" contains "+" then
delete last character of field "CalDate"
else
end if
convert field "CalDate" to seconds
put field "CalDate" into it
convert it to dateItems
put 2 into whichSix
add ((item 1 of it) - 1987) *2 to whichSix
if item 2 of it > 6 then add 1 to whichSix
visual effect zoom open
if whichSix < 1 then go card 2
else if whichSix > 8 then go card 9
else
convert it to seconds
go to card whichSix
send "bracketWeek" && it to this card
end if
end mouseUp
-- part 45 (button)
-- low flags: 80
-- high flags: 2000
-- rect: left=181 top=320 right=340 bottom=207
-- title width / last selected line: 0
-- icon id / first selected line: 30557 / 30557
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: First Card
----- HyperTalk script -----
on mouseUp
set hilite of background button "First Card" to true
go to first card of background "Action Items"
set hilite of background button "First Card" to false
click at 72,109
end mouseUp
-- part 46 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=1 top=91 right=130 bottom=41
-- title width / last selected line: 0
-- icon id / first selected line: 1007 / 1007
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print Card...
----- HyperTalk script -----
on mouseUp
set lockScreen to true
show background button "Hide button 1"
show background button "Hide button 2"
show background button "Hide button 3"
show background button "Hide button 4"
doMenu Print Card
hide background button "Hide button 1"
hide background button "Hide button 2"
hide background button "Hide button 3"
hide background button "Hide button 4"
set lockScreen to false
end mouseUp
-- part 47 (button)
-- low flags: 80
-- high flags: 2000
-- rect: left=303 top=320 right=340 bottom=327
-- title width / last selected line: 0
-- icon id / first selected line: 26865 / 26865
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Last Card
----- HyperTalk script -----
on mouseUp
set hilite of background button "Last Card" to true
go to last card
set hilite of background button "Last Card" to false
click at 72,109
end mouseUp
-- part 48 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=2 top=140 right=178 bottom=41
-- title width / last selected line: 0
-- icon id / first selected line: 15639 / 15639
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Go To Print Routines
----- HyperTalk script -----
on mouseUp
push card
go to card 1 of background "Print Routines"
end mouseUp
-- part 49 (field)
-- low flags: 81
-- high flags: 0000
-- rect: left=310 top=51 right=69 bottom=330
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: RButton T/F
-- part 51 (button)
-- low flags: 80
-- high flags: 0001
-- rect: left=0 top=0 right=342 bottom=44
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Hide Button 1
-- part 52 (button)
-- low flags: 80
-- high flags: 0001
-- rect: left=42 top=0 right=45 bottom=468
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Hide Button 2
-- part 54 (button)
-- low flags: 80
-- high flags: 0001
-- rect: left=43 top=317 right=342 bottom=470
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Hide Button 4
-- part 57 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=471 top=92 right=122 bottom=508
-- title width / last selected line: 0
-- icon id / first selected line: 2478 / 2478
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About...
----- HyperTalk script -----
on mouseUp
push card
visual effect iris open
go to first card of background "About..."
set lockScreen to true
set textFont of card field "About...Text" to Chicago
set hilite of card button "About..." to true
put " Welcome to About...Action Items" & return & return & "• Click on EVERYTHING (except the 'Done' button)." & return & return & "• Click the 'Done' button or press the ENTER key to" & " return to the Action Items." into card field "About...Text"